package com.cz.ssyx.search.controller;

import com.cz.ssyx.search.service.SkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 功能描述:
 *
 * @author 程长
 * @version 1.0
 * @date 2025/4/18 10:52
 */
@RestController
@RequestMapping("/search/sku")
public class SkuController {
    @Resource
    private SkuService skuService;

    @GetMapping("/autocomplete")
    public List<String> autocompleteSkuName(@RequestParam("prefix") String prefix) {
        return skuService.autocompleteSkuName(prefix);
    }
}
